/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86131
 * Date: 2024-01-16
 * Time: 16:25
 */
public class test {
    public static void main(String[] args) {

        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();

        System.out.println("结点的个数： ");
        binaryTree.size(root);
        System.out.println(BinaryTree.nodeSize);

        System.out.println("叶子结点的个数： ");
        binaryTree.getLeafNodeCount(root);
        System.out.println(binaryTree.leafSize);

        System.out.println(binaryTree.getLeafNodeCount2(root));

        System.out.println("第K层结点个数： ");
        System.out.println(binaryTree.getKLevelNodeCount(root,3));

        System.out.println("树的高度： ");
        System.out.println(binaryTree.getHeight(root));

        System.out.println("查找结点： ");
        BinaryTree.TreeNode ret  = binaryTree.find(root,'G');
        System.out.println(ret.val);  //这个结点的值 所以是ret.val

        System.out.println("层序遍历: ");
        binaryTree.levelOrder(root);


    }
}
